<template>
  <div class="target-btn" :class="{active: data.active}" @click="switchStatus">{{ data.label }}</div>
</template>

<script>
export default {
    props: {
        data: {
            type: Object,
            default: {}
        },
        index: {
            type: Number
        }
    },
    methods: {
        switchStatus() {
            this.$emit('change', {
                index: this.index,
                val: this.data
            });
        }
    }
};
</script>

<style lang="less">
.target-btn {
  border-radius: 16px;
  border: 1px solid rgba(200, 201, 204, 1);
  padding: 7px 15px;
  color: rgba(50, 50, 51, 1);
  margin-bottom: 15px;
  margin-left: 15px;
  &.active {
    border: 1px solid rgba(255, 167, 34, 1);
    color: rgba(255, 167, 34, 1);
  }
}
</style>